#ifndef DOPPLERSPECTRUMDISPLAYWIDGET_H
#define DOPPLERSPECTRUMDISPLAYWIDGET_H

#include <QWidget>
#include <QGridLayout>
#include "qcustomplot.h"
class RecDataThread;

class DopplerSpectrumDis : public QWidget
{
    Q_OBJECT
public:
    DopplerSpectrumDis(QWidget *parent = 0);
    ~DopplerSpectrumDis();

    void test_data_plot();
public slots:
    void rec_data_plot(uint8_t *data, uint data_size,char type);


private:
    void configplot(QCustomPlot * customPlot);

private slots:
    void set_narrow_status();
    void set_broad_status();
    void set_result_status(uint32_t result, char type );
private:

    QVBoxLayout *m_main_layout;
    QCustomPlot *m_customPlot;
    RecDataThread *m_red_thread;

    QGroupBox *m_groupBox_plot;
    QGroupBox *m_groupBox_attribute;

    QRadioButton *m_radioButton_narrow;   char m_radioButton_narrow_flag;
    QRadioButton *m_radioButton_broad;    char m_radioButton_broad_flag;


    QHBoxLayout *m_layout_hbox;
    QVBoxLayout *m_layout_vbox;

    QLabel *m_label_result;
};

class RecDataThread :  public QThread
{
    Q_OBJECT
public:
    RecDataThread();
protected:
    void run();
signals:
    void rec_data(uint8_t *data, uint data_size, char type);
    void rec_result(uint32_t result, char type);

};


#endif // DOPPLERSPECTRUMDISPLAYWIDGET_H
